
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gummworld2.vec2d</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="gummworld2.html"><font color="#ffffff">gummworld2</font></a>.vec2d</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/cygwin/home/bw/devel/python/svn/gummworld2_devel/gamelib/gummworld2/vec2d.py">c:\cygwin\home\bw\devel\python\svn\gummworld2_devel\gamelib\gummworld2\vec2d.py</a></font></td></tr></table>
    <p><tt><a href="#Vec2d">Vec2d</a>.py&nbsp;-&nbsp;Nice&nbsp;implementation&nbsp;of&nbsp;a&nbsp;2D&nbsp;vector&nbsp;coordinate.<br>
&nbsp;<br>
Source:&nbsp;<a href="http://www.pygame.org/wiki/2DVectorClass">http://www.pygame.org/wiki/2DVectorClass</a></tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="operator.html">operator</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gummworld2.vec2d.html#Vec2d">Vec2d</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Vec2d">class <strong>Vec2d</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>2d&nbsp;vector&nbsp;class,&nbsp;supports&nbsp;vector&nbsp;and&nbsp;scalar&nbsp;operators,<br>
and&nbsp;also&nbsp;provides&nbsp;a&nbsp;bunch&nbsp;of&nbsp;high&nbsp;level&nbsp;functions<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Vec2d-__abs__"><strong>__abs__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__add__"><strong>__add__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Addition</tt></dd></dl>

<dl><dt><a name="Vec2d-__and__"><strong>__and__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__div__"><strong>__div__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Division</tt></dd></dl>

<dl><dt><a name="Vec2d-__divmod__"><strong>__divmod__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Comparison</tt></dd></dl>

<dl><dt><a name="Vec2d-__floordiv__"><strong>__floordiv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Vec2d-__getslice__"><strong>__getslice__</strong></a>(self, i, j)</dt></dl>

<dl><dt><a name="Vec2d-__getstate__"><strong>__getstate__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__iadd__"><strong>__iadd__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__idiv__"><strong>__idiv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__ifloordiv__"><strong>__ifloordiv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__imul__"><strong>__imul__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__init__"><strong>__init__</strong></a>(self, x_or_pair, y<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Vec2d-__invert__"><strong>__invert__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__isub__"><strong>__isub__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__itruediv__"><strong>__itruediv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__lshift__"><strong>__lshift__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Bitwise&nbsp;operators</tt></dd></dl>

<dl><dt><a name="Vec2d-__mod__"><strong>__mod__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Modulo</tt></dd></dl>

<dl><dt><a name="Vec2d-__mul__"><strong>__mul__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Multiplication</tt></dd></dl>

<dl><dt><a name="Vec2d-__ne__"><strong>__ne__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__neg__"><strong>__neg__</strong></a>(self)</dt><dd><tt>#&nbsp;Unary&nbsp;operations</tt></dd></dl>

<dl><dt><a name="Vec2d-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__or__"><strong>__or__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__pos__"><strong>__pos__</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-__pow__"><strong>__pow__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Exponentation</tt></dd></dl>

<dl><dt><a name="Vec2d-__radd__"><strong>__radd__</strong></a> = <a href="#Vec2d-__add__">__add__</a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rand__"><strong>__rand__</strong></a> = <a href="#Vec2d-__and__">__and__</a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rdiv__"><strong>__rdiv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rdivmod__"><strong>__rdivmod__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>#&nbsp;String&nbsp;representaion&nbsp;(for&nbsp;debugging)</tt></dd></dl>

<dl><dt><a name="Vec2d-__rfloordiv__"><strong>__rfloordiv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rlshift__"><strong>__rlshift__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rmod__"><strong>__rmod__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rmul__"><strong>__rmul__</strong></a> = <a href="#Vec2d-__mul__">__mul__</a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__ror__"><strong>__ror__</strong></a> = <a href="#Vec2d-__or__">__or__</a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rpow__"><strong>__rpow__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rrshift__"><strong>__rrshift__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rshift__"><strong>__rshift__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rsub__"><strong>__rsub__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rtruediv__"><strong>__rtruediv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__rxor__"><strong>__rxor__</strong></a> = <a href="#Vec2d-__xor__">__xor__</a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>

<dl><dt><a name="Vec2d-__setslice__"><strong>__setslice__</strong></a>(self, i, j, seq)</dt></dl>

<dl><dt><a name="Vec2d-__setstate__"><strong>__setstate__</strong></a>(self, dict)</dt></dl>

<dl><dt><a name="Vec2d-__sub__"><strong>__sub__</strong></a>(self, other)</dt><dd><tt>#&nbsp;Subtraction</tt></dd></dl>

<dl><dt><a name="Vec2d-__truediv__"><strong>__truediv__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-__xor__"><strong>__xor__</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-convert_to_basis"><strong>convert_to_basis</strong></a>(self, x_vector, y_vector)</dt></dl>

<dl><dt><a name="Vec2d-cross"><strong>cross</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-dot"><strong>dot</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-get_angle"><strong>get_angle</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-get_angle_between"><strong>get_angle_between</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-get_dist_sqrd"><strong>get_dist_sqrd</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-get_distance"><strong>get_distance</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-get_length"><strong>get_length</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-get_length_sqrd"><strong>get_length_sqrd</strong></a>(self)</dt><dd><tt>#&nbsp;vectory&nbsp;functions</tt></dd></dl>

<dl><dt><a name="Vec2d-interpolate_to"><strong>interpolate_to</strong></a>(self, other, range)</dt></dl>

<dl><dt><a name="Vec2d-normalize_return_length"><strong>normalize_return_length</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-normalized"><strong>normalized</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-perpendicular"><strong>perpendicular</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-perpendicular_normal"><strong>perpendicular_normal</strong></a>(self)</dt></dl>

<dl><dt><a name="Vec2d-projection"><strong>projection</strong></a>(self, other)</dt></dl>

<dl><dt><a name="Vec2d-rotate"><strong>rotate</strong></a>(self, angle_degrees)</dt></dl>

<dl><dt><a name="Vec2d-rotated"><strong>rotated</strong></a>(self, angle_degrees)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>angle</strong></dt>
<dd><tt>gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;angle&nbsp;of&nbsp;a&nbsp;vector</tt></dd>
</dl>
<dl><dt><strong>length</strong></dt>
<dd><tt>gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;magnitude&nbsp;of&nbsp;the&nbsp;vector</tt></dd>
</dl>
<dl><dt><strong>x</strong></dt>
</dl>
<dl><dt><strong>y</strong></dt>
</dl>
</td></tr></table></td></tr></table>
</body></html>